package com.open.pay.wechat.sdk.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author zhang kaichao
 * @since 2020/12/29 22:27:16
 */
public class ThreadUtil {

	public static ExecutorService fixedThreadPool(int nThreads) {
		return Executors.newFixedThreadPool(nThreads, r -> {
			Thread t = Executors.defaultThreadFactory().newThread(r);
			t.setDaemon(true);
			return t;
		});
	}

}
